﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Observer
{
    /// <summary>
    /// This is the class to handle the billing service
    /// </summary>
    public class BillingService
    {
        public void Update(object subject)
        {
            // Depend on which kind of object is being updated, it uses a different charge mechansim
            if (subject is ChineseFood)
                GenerateCharge((ChineseFood)subject);
        }

        /// <summary>
        /// Charge API for the Chinese food
        /// </summary>
        /// <param name="food"></param>
        private void GenerateCharge(ChineseFood food)
        {
            string name = food.Name;

            //code to generate charge for correct food
        }
    } 
}
